Skip to content

feat(docker): show container MAC addresses#2621

Merged
limetech merged 5 commits intomasterfrom
codex/7.3-docker-mac-address
Apr 22, 2026
Merged

feat(docker): show container MAC addresses#2621
limetech merged 5 commits intomasterfrom
codex/7.3-docker-mac-address

Conversation

@elibosley
Copy link
Copy Markdown
Member

@elibosley elibosley commented Apr 21, 2026

Summary

  • Preserve Docker network endpoint MacAddress values from inspect data in DockerClient.
  • Update the Container IP heading to show the advanced-only / MAC context.
  • Show each MAC address on the line beneath the matching Container IP in advanced view, without adding a separate table column.

Why

Users running containers on macvlan need the container MAC address for router and network configuration. Before this change, the UI did not expose that value, so users had to SSH into Unraid and run docker inspect manually.

Testing

  • php -l emhttp/plugins/dynamix.docker.manager/include/DockerClient.php
  • php -l emhttp/plugins/dynamix.docker.manager/include/DockerContainers.php
  • php -l emhttp/plugins/dynamix.docker.manager/DockerContainers.page
  • git diff --check

Summary by CodeRabbit

  • New Features

    • Show per-network MAC addresses alongside container IPs in the advanced network view and update the column header to reflect "IP / MAC".
  • Bug Fixes

    • Fix empty-state and loading placeholder column alignment to match the updated column count.
    • Improve handling and safe rendering when network or MAC information is absent to avoid null/undefined output.

- Purpose: expose Docker endpoint MAC addresses in the advanced container list for router and macvlan configuration workflows.
- Before: the Docker page showed container network names and IPs, but discarded MacAddress from inspect data.
- Problem: users had to SSH into Unraid and run docker inspect manually to find MAC addresses.
- Change: preserve MacAddress for each container network and render it in an advanced-only MAC Address column.
- Implementation: carries MacAddress through DockerClient network metadata and displays aligned values in DockerContainers.php.
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 21, 2026

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: dd963a14-acd3-4c69-92d9-983b0834397b

📥 Commits

Reviewing files that changed from the base of the PR and between 64b1bc5 and 753204c.

📒 Files selected for processing (1)
  • emhttp/plugins/dynamix.docker.manager/include/DockerContainers.php
🚧 Files skipped from review as they are similar to previous changes (1)
  • emhttp/plugins/dynamix.docker.manager/include/DockerContainers.php

Walkthrough

Backend now collects per-network MAC addresses from Docker API responses; templates and rendering were updated to show MACs inline with network IPs and the table header and placeholder colspan were adjusted to account for the added column.

Changes

Cohort / File(s) Summary
Page template
emhttp/plugins/dynamix.docker.manager/DockerContainers.page
Expanded the “Container IP” header to include an inline “MAC” suffix (Container IP / MAC) and updated the loading/empty placeholder row colspan from 9 to 10.
Backend: Docker client
emhttp/plugins/dynamix.docker.manager/include/DockerClient.php
getDockerContainers() now collects MacAddress per-network (and for NetworkMode) with defensive fallbacks; Networks entries now include both IPAddress and MacAddress.
Rendering logic
emhttp/plugins/dynamix.docker.manager/include/DockerContainers.php
Network IPs and MACs are HTML-escaped; per-network MACs (default '') are appended as an .advanced line under the IP when present. Empty-state/placeholder colspan updated to 10.

Sequence Diagram(s)

(omitted — changes are localized UI/data formatting and do not introduce multi-component sequential flows)

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

🐇 I hopped through JSON, nibbling at each crack,
Found IPs and MACs and tucked them in a stack,
A sprinkle of escape, a careful little line,
Now rows are neat and tidy — everything in sign,
I twitch my nose and celebrate with a snack 🥕

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'feat(docker): show container MAC addresses' clearly and concisely describes the main change: adding container MAC address display functionality to the Docker manager interface.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/7.3-docker-mac-address

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 21, 2026

🔧 PR Test Plugin Available

A test plugin has been generated for this PR that includes the modified files.

Version: 2026.04.22.0008
Build: View Workflow Run

📥 Installation Instructions:

Install via Unraid Web UI:

  1. Go to Plugins → Install Plugin
  2. Copy and paste this URL:
https://preview.dl.unraid.net/pr-plugins/pr-2621/webgui-pr-2621.plg
  1. Click Install

Alternative: Direct Download

⚠️ Important Notes:

  • Testing only: This plugin is for testing PR changes
  • Backup included: Original files are automatically backed up
  • Easy removal: Files are restored when plugin is removed
  • Conflicts: Remove this plugin before installing production updates
  • Post-merge behavior: This preview stays available after merge until preview storage expires or it is manually cleaned up

📝 Modified Files:

Click to expand file list
emhttp/plugins/dynamix.docker.manager/DockerContainers.page
emhttp/plugins/dynamix.docker.manager/include/DockerClient.php
emhttp/plugins/dynamix.docker.manager/include/DockerContainers.php

🔄 To Remove:

Navigate to Plugins → Installed Plugins and remove webgui-pr-2621, or run:

plugin remove webgui-pr-2621

🤖 This comment is automatically generated and will be updated with each new push to this PR.

@elibosley elibosley added the 7.3 label Apr 21, 2026
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
emhttp/plugins/dynamix.docker.manager/include/DockerContainers.php (1)

352-352: Fix orphan row column span to match the 11-column table.

Line 352 currently yields a 9-cell row (1 + 7 + 1) in an 11-column table, which can misalign orphan rows in advanced view.

Proposed alignment fix
-  echo "</td><td colspan='7'>"._('Image ID').": $id<br>";
+  echo "</td><td colspan='9'>"._('Image ID').": $id<br>";
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@emhttp/plugins/dynamix.docker.manager/include/DockerContainers.php` at line
352, The orphan row uses "<td colspan='7'>" which creates a 9-cell row (1 + 7 +
1) in an 11-column table; update the colspan in DockerContainers.php (the echo
that prints "Image ID: $id") from 7 to 9 so the row becomes 1 + 9 + 1 = 11 and
aligns correctly with the table.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@emhttp/plugins/dynamix.docker.manager/include/DockerContainers.php`:
- Line 352: The orphan row uses "<td colspan='7'>" which creates a 9-cell row (1
+ 7 + 1) in an 11-column table; update the colspan in DockerContainers.php (the
echo that prints "Image ID: $id") from 7 to 9 so the row becomes 1 + 9 + 1 = 11
and aligns correctly with the table.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 4fa83fd4-cb23-47e3-bc78-51f8b13f11ea

📥 Commits

Reviewing files that changed from the base of the PR and between 7756908 and 23551f7.

📒 Files selected for processing (3)
  • emhttp/plugins/dynamix.docker.manager/DockerContainers.page
  • emhttp/plugins/dynamix.docker.manager/include/DockerClient.php
  • emhttp/plugins/dynamix.docker.manager/include/DockerContainers.php

- Purpose: keep the Docker container table compact while still exposing MAC addresses in advanced view.
- Before: the PR added a separate advanced-only MAC Address column next to Container IP.
- Problem: the extra column widened the Docker page table for data that belongs with each endpoint IP.
- Change: render each network MAC address as an advanced-only line beneath the matching container IP.
- Implementation: removes the MAC Address header and extra cell while preserving MacAddress data from DockerClient.
- Purpose: make the advanced Docker network value more compact and readable.
- Before: MAC addresses appeared beneath the container IP as a stacked advanced-only line.
- Problem: the requested presentation is a single Container IP / MAC value.
- Change: updates the heading to include advanced-only / MAC text and renders MAC addresses inline after the container IP with a slash separator.
- Implementation: keeps the MAC span advanced-only so basic view continues to show only the container IP.
- Purpose: match the requested advanced Docker cell presentation.
- Before: the MAC address rendered inline after the container IP with a slash separator.
- Problem: the desired layout is easier to scan as two lines without a MAC label.
- Change: renders the container IP first and the raw MAC address on the next advanced-only line.
- Implementation: keeps the MAC value inside the advanced span so basic view remains unchanged.
Comment thread emhttp/plugins/dynamix.docker.manager/include/DockerContainers.php Outdated
- Purpose: address PR feedback about matching MAC visibility to container IP visibility.
- Before: stopped containers hid the IP address but could still carry a MAC address value into the advanced cell.
- Problem: the MAC line should follow the same running-state behavior as the IP line.
- Change: only renders a network MAC address when the container is running.
- Implementation: applies the existing running check to the MacAddress display value.
@limetech limetech merged commit d71f545 into master Apr 22, 2026
5 checks passed
@limetech limetech deleted the codex/7.3-docker-mac-address branch April 22, 2026 05:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants